<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset() . PHP_EOL; ?>
	<title>
	<?php
		echo __d('lil', 'LilAdmin', true); 
		if (!empty($title_for_layout)) echo ' :: ' . $title_for_layout;
	?>
	</title>
	<?php echo $this->Html->css('/lil/css/lil') . PHP_EOL; ?>
	<?php echo $this->Html->css('/lil/css/style') . PHP_EOL; ?>
	<?php echo $scripts_for_layout . PHP_EOL; ?>
</head>
<body>
	<div id="container">
		<?php if ($this->Session->check('Message.flash')) echo $this->Session->flash(); ?>
		<?php if ($this->Session->check('Message.auth')) echo $this->Session->flash('auth'); ?>
		<div id="header">
			<div id="header_logo">
			<?php
				echo $this->Html->link(
					$this->Html->image('/lil/img/logo.gif'),
					'/',
					array('escape' => false)
				);
			?>
			</div>
			<div id="header_change_blog">
			<?php
				if ($this->Auth->user('id')) {
					echo $this->Html->link(
						__d('lil', 'Switch to another blog', true),
						array(
							'plugin'     => 'lil',
							'controller' => 'blogs',
							'action'     => 'admin_list',
						)
					);
				}
			?>&nbsp;
			</div>
			<h1>
			<?php
				if (!empty($admin_blog)) {
					echo $this->Html->link(
						$admin_blog['Blog']['name'],
						array(
							'plugin'     => 'lil',
							'controller' => 'posts',
							'action'     => 'index',
							'blog'       => $admin_blog['Blog']['slug'],
							'admin'      => false,
						)
					);
				} else {
					echo __d('lil', 'Welcome to Lil', true);
				}
			?>
			</h1>
		</div>
		<div id="content">
			<div id="sidebar">
				<?php echo $this->element('admin_sidebar'); ?>
			</div>
			<div id="main">
				<?php echo $content_for_layout;?>
			</div>
			<div style="clear: both">&nbsp;</div>
		</div>
	</div>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>